.ui-avatar {
  border-radius: 50%;
  display: block;
  position: relative;
  margin: 0;
  padding: 0;
  z-index: 2;
}

.ui-avatar:after {
  width: 100%;
  height: 100%;
  position: absolute;
  border-radius: 50%;
  content: attr(data-fallback-initials);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 500;
  z-index: 0;
}

.ui-avatar__avatar {
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  z-index: 1;
}

.ui-avatar--small {
  width: 24px;
  height: 24px;
  font-size: 1rem;
}

.ui-avatar--medium {
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
}

.ui-avatar--large {
  width: 60px;
  height: 60px;
  font-size: 2rem;
}

.ui-avatar--extra-large {
  width: 90px;
  height: 90px;
  font-size: 3rem;
}

.ui-avatar--extra-extra-large {
  width: 130px;
  height: 130px;
}

.ui-avatar--fallback-orange:after {
  background-color: var(--orange500);
}

.ui-avatar--fallback-pink:after {
  background-color: var(--pink500);
}

.ui-avatar--fallback-green:after {
  background-color: var(--green500);
}

.ui-avatar--fallback-blue:after {
  background-color: var(--blue500);
}

.ui-avatar--fallback-navy:after {
  background-color: var(--navy900);
}

.ui-avatar--grouped {
  margin-left: -0.45em;
  box-shadow: 0 0 0 2px var(--white);
}

.ui-avatar--grouped .ui-avatar--large,
.ui-avatar--grouped .ui-avatar--extra-large {
  box-shadow: 0 0 0 3px var(--white);
}

.ui-avatar--grouped .ui-avatar--large,
.ui-avatar--grouped .ui-avatar--extra-large {
  border: 3px solid var(--white);
}

.ui-avatar--grouped:nth-of-type(1) {
  z-index: 5;
}

.ui-avatar--grouped:nth-of-type(2) {
  z-index: 4;
}

.ui-avatar--grouped:nth-of-type(3) {
  z-index: 3;
}

.ui-avatar--grouped:nth-of-type(4) {
  z-index: 2;
}

.ui-avatar--grouped:nth-of-type(5) {
  z-index: 1;
}

.ui-avatar--grouped:first-of-type {
  margin-left: 0;
}
